package org.hackystat.iw.projectoverviewer.page.treemap;

import org.apache.wicket.PageParameters;
import org.apache.wicket.util.tester.WicketTester;
import org.hackystat.iw.projectoverviewer.ProjectOverviewerApplication;
import org.hackystat.iw.projectoverviewer.test.ProjectOverviewerTestHelper;
import org.junit.Test;

/**
 * Tests the treemap page.
 * 
 * @author Jianfei Liao
 * @author Nathan Britton
 */
public class TestTreeMapPage extends ProjectOverviewerTestHelper {
  
  /**
   * Tests the treemap.
   */
  @Test
  public void testTreeMap() { // NOPMD
    WicketTester tester = new WicketTester(new ProjectOverviewerApplication(getTestProperties()));
    
    // required page parameters so the treemap page can be constructed correctly
    PageParameters testParam = new PageParameters();
    testParam.put("projectName", "TestProject");
    testParam.put("strategy", "squarified");
    testParam.put("colorProvider", "RedGreen Linear");
    testParam.put("size", "MethodCounts");
    testParam.put("color", "Coverage");
    
    tester.startPage(TreeMapPage.class, testParam);
    
    tester.assertRenderedPage(TreeMapPage.class);
  }
}